package com.ruoyi.project.pay.weixin.modal;

import com.github.wxpay.sdk.WXPayConfig;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.io.InputStream;

/**
 * @author 张泽宇
 * @date 2020/9/29 15:00
 */
@Data
@Component
//@ConfigurationProperties(prefix = "wx-pay.refundMoney")
public class MyConfigModal implements WXPayConfig {
    /** 退款订单*/
    private String orderNo;
    /** 退款订单号*/
    private String refundOrderNo;
    /** 订单金额*/
    private String totalFee;
    /** 退款金额*/
    private String refundFee;
    /** 退款原因*/
    private String refundReason;

    /**
     * 小程序appid
     */
    @Value("${wx-pay.refund.appID}")
    private String appID;
    /**
     * 商户号
     */
    @Value("${wx-pay.refund.mchID}")
    private String mchID;
    /**
     * 商户key
     */
    @Value("${wx-pay.refund.key}")
    private String key;


    public InputStream getCertStream() {
        InputStream resourceAsStream = getClass().getClassLoader().getResourceAsStream("apiclient_cert.p12");
        return resourceAsStream;
    }

    public int getHttpConnectTimeoutMs() {
        return 8000;
    }

    public int getHttpReadTimeoutMs() {
        return 10000;
    }

}
